package main


import (
"fmt"
"reflect"
"unsafe"
)

type mma interface {
   Start() 
}

type A  struct{
    Aa  int
}

type B  struct{
    A
    Bb  int
}


type C  struct{
    A
    Cc  int
}

type D struct{
   B
   C
   dd int
   Feixun func(...int)
}

func (t *D)Study(...int) {
  
  fmt.Println("I'm Study")
}



func study(...int) {

  fmt.Println("I'm Parent")
}

func son(...int) {

  fmt.Println("I'm Son")
  
}

type Sq func(...int)

func main(){


   p1 :=   &D{}

   p1.Feixun = son

   p1.Feixun()

//   p1.Study = son
   fmt.Println(p1.Feixun, son, p1.dd, unsafe.Pointer(p1) )

   fmt.Println(*(* int)(unsafe.Pointer(uintptr(unsafe.Pointer(p1)) + 40)))

//  (Sq)(unsafe.Pointer(uintptr(unsafe.Pointer(p1)) + 40))()

   H:=fmt.Sprintf("%016x", reflect.ValueOf(p1).Pointer())

   fmt.Println("result:",H)
 
   p1.Study()

   b := study

   c := son

   b = c

   b()

   a:=    reflect.ValueOf(study)

   fmt.Println(   a.Type().In(0).Elem())

   fmt.Println("ok")

}
